<template>
<div class="layerRtb layerRtb-threecolumn">
    <three-title :title="{name:'摄像头详情'}"></three-title>
    <div class="layerRtb-scroll thinScroll" v-scrollHeight = "137">
        <div class="analyItem">
            <p class="analyItemTit tx-center">状态</p>
            <div class="analyItemCon">
                <p class="col-md-6">
                    <span class="cLightGray pr8">电量</span>
                    <span>{{sxtModel.power}}</span>
                </p>
                <p class="col-md-6">
                    <span class="cLightGray pr8">最后通信</span>
                    <span>{{sxtModel.datatime}}</span>
                </p>
                <p class="col-md-6">
                    <span class="cLightGray pr8">最后拍照</span>
                    <span>{{sxtModel.phototime}}</span>
                </p>
                <p class="col-md-6">
                    <span class="cLightGray pr8">最后上传</span>
                    <span>{{sxtModel.uploadtime}}</span>
                </p>
                <p class="col-md-6">
                    <span class="cLightGray pr8">通讯状态</span>
                    <span>{{sxtModel.datastate===0?'异常':''}}</span>
                </p>
                <p class="col-md-6">
                    <span class="cLightGray pr8">拍照状态</span>
                    <span>{{sxtModel.photostate===0?'异常':''}}</span>
                </p>
                <p class="col-md-6">
                    <span class="cLightGray pr8">上传状态</span>
                    <span>{{sxtModel.uploadstate===0?'异常':''}}</span>
                </p>
            </div>
        </div>
        <div class="analyItem">
            <p class="analyItemTit tx-center">存放位置</p>
            <div class="analyItemCon">
                <p class="col-md-12">
                    <span class="cLightGray pr8">地址</span>
                    <span>{{'/'+leftInfo.orderno+'/'+point+'/'}}</span>
                </p>
            </div>
        </div>
        <div class="analyItem" v-for="(item, index) in zplist" :key="index">
            <p class="analyItemTit tx-center">{{item.showTime}}</p>
            <div class="analyItemCon">
                <p class="col-md-3">
                    <span class="cLightGray pr8">应拍</span>
                    <span>{{item.dayCount}}</span>
                </p>
                <p class="col-md-3">
                    <span class="cLightGray pr8">实拍数量</span>
                    <span>{{item.count}}</span>
                </p>
            </div>
        </div>
    </div>
    <div class="layerRtb-footer">
        <div class="analyItem">
            <p class="analyItemTit tx-center">综合</p>
            <div class="analyItemCon">

            </div>
        </div>
    </div>
</div>
</template>
<script>
import { selectPhotoParamInfoByImei, selectPhotoListByImei } from '../../Resources/Api/index'
import { mapGetters } from 'vuex'
export default {
    data () {
        return {
            sxtModel: [], // 项目材料订单信息
            id: 0,
            zplist: [],
            point: 0
        }
    },
    created () {
        this.point = this.$route.query.pointid

        this.load()
    },
    computed: {
        ...mapGetters(['leftInfo', 'userInfo'])
    },
    methods: {
        // 路由跳转路径拼接
        routerPath (path) {
            return this.$route.matched[1].path + '/' + path
        },
        // 直接进行路由跳转路径
        routerPush (path) {
            this.$router.push(this.$route.matched[1].path + '/' + path)
        },
        load () {
            selectPhotoParamInfoByImei({
                imei: this.$route.query.i
            }).then((result) => {
                this.sxtModel = result.data.Body
            }).catch((err) => {
                console.log(err)
            })
            selectPhotoListByImei({
                imei: this.$route.query.i,
                pointid: this.$route.query.pointid,
                orderno: this.leftInfo.orderno
            }).then((result) => {
                this.zplist = result.data.Body
            }).catch((err) => {
                console.log(err)
            })
        }

    },
    watch: {
        $route () {
            this.point = this.$route.query.pointid
            this.load()
        }
    },
    filters: {
        stage (parone) {
            let value = ''
            switch (parone) {
            case 0:
            case 10:
                value = '审计'
                break
            case 20:
                value = '准备'
                break
            case 30:
                value = '在施'
                break
            case 31:
                value = '施前'
                break
            case 32:
                value = '施中'
                break
            case 33:
                value = '施尾'
                break
            case 40:
                value = '竣工'
                break
            case 50:
                value = '完工'
                break
            case 60:
                value = '历史'
                break
            case 70:
                value = '坏账'
                break
            case 80:
                value = '退单'
                break
            }
            return value
        }
    }
}
</script>
